package test2.timer;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.CountDownLatch;

import org.joda.time.LocalDateTime;

public class App {
	
	public static void main(String[] args) throws InterruptedException {
//		CountDownLatch latch = new CountDownLatch(1);
		Timer timer = new Timer();
		System.out.println(new Date());
		timer.schedule(new TimerTask() {
			
			@Override
			public void run() {
//				timer.cancel();
				System.out.println("test");
				System.out.println(new Date());
//				latch.countDown();
			}
		}, LocalDateTime.now().plusSeconds(3).toDate(), 1000);
//		latch.await();
		System.out.println("hello world...");
	}

}
